<template>
	<view class="home-page">
		<image class="home-page-logo" src="/static/caifa/banner.jpg" mode="aspectFill"></image>
		<view class="homepage">
			<view class="homepage-item" @click="inform">
				<view class="item-img1"></view>
				<text class="item-text">林农个人采伐申请</text>
				<text class="item-text2">人工商品林蓄积量30立方米(含)以下</text>
			</view>
			<view class="homepage-item" @click="record">
				<view class="item-img2"></view>
				<text class="item-text">查看申请记录</text>
				<text class="item-text2">可查看个人采伐申请进度流程</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				regions: []
			}
		},
		onLoad() {
			this.getdata()
		},
		methods: {
			inform() {
				uni.navigateTo({
					url: '/pages/inform/inform'
				})
			},
			record() {
				uni.navigateTo({
					url: '/pages/record/record'
				})
			},
			async getdata() {
				let res =await this.muajax.queryRegionListByLevel()
				if (res.code == '0000') {
					console.log(res)
					this.$store.dispatch('saveData', {
						field: 'RegionList',
						value: res.regions.map((item) => {
							item.name = item.rname;
							return item;
						}),
						keep: true,
					})
				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.home-page {
		display: flex;
		flex-direction: column;
		height: 100%;
		background: rgba(248, 248, 248, 1);

		.home-page-logo {
			// background-image: url(~@/static/caifa/banner.png);
			height: 416rpx;
			background-size: cover;
			width: 100%;
			z-index: 0;
		}

		.homepage {
			flex: 1;
			padding: 0 42rpx;
			margin-top: -62rpx;
			z-index: 1;

			.homepage-item {
				height: 292rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 0rpx 42rpx 0rpx rgba(70, 70, 70, 0.1);
				border-radius: 21rpx;
				margin-bottom: 42rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				.item-img1 {
					background-image: url(~@/static/caifa/shenqing.png);
					background-size: 100% 100%;
					margin-bottom: 21rpx;
					width: 83rpx;
					height: 83rpx;
				}

				.item-img2 {
					background-image: url(~@/static/caifa/chaxun.png);
					background-size: 100% 100%;
					margin-bottom: 21rpx;
					width: 83rpx;
					height: 83rpx;
				}

				.item-text {
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 36rpx;
					color: #333333;
				}

				.item-text2 {
					font-family: PingFang SC;
					font-weight: 400;
					font-size: 29rpx;
					color: #333333;
					opacity: 0.7;
					margin-top: 12rpx;
				}
			}
		}
	}
</style>